<template>
  <div>
    <h1>Login</h1>
    <router-link to="/register">没有账户，请注册</router-link><br>
    <a href="#" @click="goRegister">没有账户，请请注册</a>
  </div>
</template>

<script lang='ts'>
import {ref,reactive} from 'vue'
import {useRouter} from 'vue-router'
export default{
 setup(){
  const router=useRouter()
  const goRegister=(e:MouseEvent)=>{
    //取消默认行为
    e.preventDefault()
    //编程式路由跳转简写方法
    //router.push('/register')
    //编程式路由跳转的标准写法
    router.push({
      path:'/register'
    })
  }
  return{
    goRegister
  }
 }
}
</script>

<style lang='scss' scoped>
</style>